<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
	<!-- 引入easyUi 的主题样式  和  easyUi 提供的图标样式 -->
	<link rel="stylesheet"
		href="${pageContext.request.contextPath}/themes/bootstrap/easyui.css" />
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/themes/icon.css">
	<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/jquery-1.9.1.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.easyui.min.js"></script>
	<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/easyui-lang-zh_CN.js"></script>

	
</head>
<script type="text/javascript">
	 $(function() {
		//配置数据表格
		$('#dg').datagrid({    
		    url:'kqjl',    
		    columns:[[  
		        {field:'ck',width:100,checkbox:true},
		        {field:'eid',title:'id',width:100,hidden:true},
		        {field:'userName',title:'姓名',width:100},
		        {field:'userDpartment',title:'部门',width:100,align:'right'},
		        {field:'startTime',title:'签到时间',width:160,align:'right'},
		        {field:'endTime',title:'离开时间',width:160,align:'right'}
		    ]],
		  	rownumbers:true,
		    pagePosition:'bottom',
		    pagination:true,
		    pageSize:3,
		    pageList:[3,6,9],
		    toolbar: [{
				
				handler: function(){
			
				}
			}]

		});
		//查询部门
		$('#department').combobox({    
		    url:'findDepartment',    
		    valueField:'id',    
		    textField:'text',
		    editable:false,  
		    value: '请选择要查询的部门',
		    panelHeight:'auto',
		    onSelect: function(node){
		    	var departmentId =node.id;
		    	//根据部门查询考勤记录
		    	$('#dg').datagrid({    
				    url:'findEntryByDepartment',   
				    
				    columns:[[  
				        {field:'ck',width:100,checkbox:true},
				        {field:'eid',title:'id',width:100,hidden:true},
				        {field:'userName',title:'姓名',width:100},
				        {field:'userDpartment',title:'部门',width:100,align:'right'},
				        {field:'startTime',title:'签到时间',width:160,align:'right'},
				        {field:'endTime',title:'离开时间',width:160,align:'right'}
				    ]],
				    queryParams: {"did":departmentId},
				  	rownumbers:true,
				    pagePosition:'bottom',
				    pagination:true,
				    pageSize:3,
				    pageList:[3,6,9],
				    toolbar: [{
						
						handler: function(){
					
						}
					}]

				});
		    }
		
		});
		
		
	})
</script>
<body>
	<dir class="content_table">
	
	<table id="dg">
	<select id="department" name="dept" style="width:150px" class="easyui-combobox">
	</table> 
	</dir>
</body>
</html>